package com.yksj.healthtalk.ui.friend;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;

import com.yksj.healthtalk.comm.BaseFragmentActivity;
import com.yksj.healthtalk.entity.CustomerInfoEntity;
import com.yksj.healthtalk.net.socket.SmartFoxClient;
import com.yksj.healthtalk.ui.R;
import com.yksj.healthtalk.ui.app.HTalkApplication;
import com.yksj.healthtalk.ui.chatting.ChatActivity;
import com.yksj.healthtalk.ui.chatting.DoctorChatActivity;
import com.yksj.healthtalk.utils.FriendHttpUtil;
import com.yksj.healthtalk.utils.ViewFinder;
/**
 * 多美医生 助理 详细资料界面
 * @author root
 *  -1 多美医生
 */
public class SystemUserInforActivity extends BaseFragmentActivity implements OnClickListener {
	String mId;
	private ViewFinder finder;
	@Override
	protected void onCreate(Bundle arg0) {
		super.onCreate(arg0);
		setContentView(R.layout.system_userinfo);
		mId = getIntent().getStringExtra("id");
		finder = new ViewFinder(this);
		initTitle();
		initView();
	}
	
	private void initView(){
		titleLeftBtn.setOnClickListener(this);
		
		TextView name=finder.textView(R.id.customer_data_name);//昵称
		TextView speciality=finder.textView(R.id.speciality);//特长
		ImageView mCusterView=finder.imageView(R.id.customer_data_image);
		TextView data=finder.textView(R.id.customer_data_add);//特长
		
		if("-1".equals(mId)){
			name.setText("多美医生");
			speciality.setText(getString(R.string.system_doctor));
			mCusterView.setBackgroundResource(R.drawable.home_icondoctress);
			data.setText("我是多美医生");
			titleTextV.setText("多美诊所");
		}else{
			titleTextV.setText("多美助理");
			mCusterView.setBackgroundResource(R.drawable.icon_healper);
		}
		finder.onClick(R.id.talk_button, this);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.title_back:
			onBackPressed();
			break;
		case R.id.talk_button:
			if("-1".equals(mId)){//多美医生
				Intent intent = new Intent(this,DoctorChatActivity.class);
				startActivity(intent);
			}else{//助理
				CustomerInfoEntity entity = HTalkApplication.getAppData().getCustomerInfoEntity(SmartFoxClient.helperId);
				Intent intent = new Intent();
				intent.setClass(this,ChatActivity.class);
				intent.putExtra(ChatActivity.KEY_PARAME, entity);
				startActivity(intent);
			}
			break;
		}
		
	}
}
